package com.ybkj.daijia.server.service;

import com.ybkj.daijia.chart.TableOrderMonthVo;
import com.ybkj.daijia.common.CompanyOrderVo;
import com.ybkj.daijia.common.DriverOrderDetailVo;
import com.ybkj.daijia.common.DriverOrderVo;
import com.ybkj.daijia.common.MemberOrderVo;
import com.ybkj.daijia.common.OrderFromSourceVo;
import com.ybkj.daijia.common.PageVo;
import com.ybkj.daijia.common.Result;
import com.ybkj.daijia.page.Page;
import com.ybkj.daijia.server.mc.Passenger;
import com.ybkj.daijia.server.model.ChartDay;
import com.ybkj.daijia.server.model.ChartMonth;
import com.ybkj.daijia.server.model.ChartYear;
import com.ybkj.daijia.server.model.Driver;
import com.ybkj.daijia.server.model.Rate;
import com.ybkj.daijia.server.zhuanxian.Car;
import com.ybkj.daijia.server.zhuanxian.Line;
import com.ybkj.daijia.server.zhuanxian.Order;
import com.ybkj.daijia.server.zhuanxian.OrderOrbit;
import com.ybkj.daijia.server.zhuanxian.PayRecordOrder;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface ZhuanxianService {

    public List<Line> queryLines(Long companyId);

    public Page<Map> queryCarsByParams(Long companyId, String companyNames, String lineName,
        String carNumber, String employName, String allstatus);

    public Map<String, Object> createCar(Long companyId, String companyName, String carName,
        String carNumber, Long[] lineId, Long employId, String employName, Integer ridepeopleNumber)
        throws ParseException;

    public Car findCar(Long id);

    public Map<String, Object> updateCar(Long carId, Long companyId, String companyName,
        String carName, String carNumber, Long[] carTypeId, Integer status, Long employId,
        String employName, Integer ridepeopleNumber);

    public Page<Line> queryByLineCompany(Long companyId, String companyName);

    public Map<String, Object> createLine(Long companyId, String companyName, String name,
        String startCity, String startAddress, String endCity, String endAddress, Long areaId,
        Long jihuoAreaId, Long baocheAreaId, String contactNumber, Long[] roleId);

    public Map<String, Object> updateLine(String id, Long companyId, String companyName,
        String name,
        String startCity, String startAddress, String endCity, String endAddress, Long areaId,
        Long jihuoAreaId, Long baocheAreaId, String contactNumber);

    public Map<String, Object> deleteCar(Long id, Long[] lineId);

    public Map<String, Object> deleteLine(Long id);

    public Page<Map<String, Object>> orderListData(String orderNumber, String clientPhone,
        String driverPhone, String companyName, String startTime, String endTime,
        String allorderType, String allstatus, Integer page, Integer rows, String treatment,
        String startFinishTime, String endFinishTime) throws ParseException;

    public List<Map<String, Object>> orderListDataExport(String orderNumber, String clientPhone,
        String driverPhone, String companyName, String startTime, String endTime,
        String allorderType, String allstatus, String treatment, String startFinishTime,
        String endFinishTime) throws ParseException;

    public List<Car> findCarByNumber(String carNumber);

    public Order findOne(Long id);

    public Line findByLine(Long lineId);

    public Result<List<Order>> createOrder(Integer orderType, Long peopleNumber, Long passengerId,
        String passengerName, String passengerPhone, Long companyId, String companyName,
        Long lineId,
        String startAddress, Double startLat, Double startLng, String endAddress, Double endLat,
        Double endLng, Date serverDate, Double budgetPay, Double startPrice, Double mileagePrice,
        Double runTimePrice, Integer travelTime, Double mileage, String channelName, Long couponId,
        String takeDeliveryName, String takeDeliveryPhone, String username, String memo);

    public List<Line> getLinesByCar(Long carId);

    public List<Order> listNewOrders();

    public List<Order> findActivedOrdersByDriver(Long employId);

    public void remark(Long id, String memo);

    public Result<Order> cancelOrder(Order order, String cancelCause, String operator);

    public ChartYear dataForYear(Integer year, Long companyId);

    public ChartMonth zhuanxianDataForMonth(Integer year, Integer month, Long companyId);

    public ChartDay zhuanxianDataForDay(Integer year, Integer month, Integer day, Long companyId);

    public List<TableOrderMonthVo> tableOrderMonth(Integer year, Long companyId);

    public PageVo<OrderFromSourceVo> orderFromSource(Date start, Date end, Long companyId);

    public PageVo<MemberOrderVo> zhuanxianMemberOrder(Date start, Date end, Long companyId,
        Long gradeId, Integer type);

    public PageVo<DriverOrderVo> zhuanxianIntroduce(Long companyId, Date start, Date end);

    public PageVo<DriverOrderDetailVo> driverOrderDetail(Long driverId, Date start, Date end);

    public PageVo<CompanyOrderVo> companyOrder(Date start, Date end);

    public Result<Order> callback(Long id, Driver driver, String cause);

    public Long countUsedSeatingByDriver(Long employId);

    public Result<Order> paidan(Driver driver, Order order);

    public Result<Order> autoPaidan(Driver driver, Order order);

    public List<Car> findCarByLine(Long lineId);

    public boolean isReceiveAnOrder(Long peopleNumber, Integer orderType, Long id);

    public List<Order> findMonthOrder(Integer year, Integer month);

    public void acceptInfoFee(Driver driver, Order order);

    public List<Order> findOrderFinishedBycompanyId(Long companyId, Date start, Date end,
        Long lineId);

    public Long countOrderFinishedBycompanyId(Long companyId, Date start, Date end, Long lineId);

    public List<Order> selectCuidan();

    public void closeCuidan(Long orderId);

    public Result<Order> confirmTask(Order order, String xml);

    public Result<Order> completeTaskNewV3(Order order, Passenger passenger, Driver driver,
        String string, String payType, BigDecimal hasPayed);

    public Result<PayRecordOrder> createPayRecordOrder(PayRecordOrder payRecordOrder);

    public PayRecordOrder findOnePayRecordOrder(Long orderId);

    public Result<PayRecordOrder> payRecordOrderTreatment(PayRecordOrder payRecordOrder);

    public List<Order> queryByEmployId(Long id, String string);

    public Long countNotPayByPassenger(Long id);

    public Result<Order> updateRealMoney(Order order, BigDecimal couponMoney, BigDecimal cashMoney,
        BigDecimal signMoney, BigDecimal balanceMoney, BigDecimal alipayMoney,
        BigDecimal weixinMoney, BigDecimal driverMoney, BigDecimal memberMoney, BigDecimal wxMoney,
        String content);

    public OrderOrbit findOrbitByOrderId(Long id);

    public List<Order> queryRunOrderByEmploy(Long id);

    public List<Order> findRunOrderByLineId(Long id);

    public List<Order> queryRunOrderByCar(Long id);

    public Page<Order> findByDriverAndFinishTime(Long employId, Date begin, Date end, Integer page,
        Integer limit);

    public Long countActivedOrdersByDriver(Long driverId);

    public Rate findRateOne(Long id);

    public void deleteRateOne(Long id);

    public List<com.ybkj.daijia.server.zhuanxian.Order> findByStatus(Integer orderStatusPaidan);

    public void revoke(com.ybkj.daijia.server.zhuanxian.Order order, String string);

    public Long countFinishedByPassengerAndFinishTime(Long id, String orderFromSource,
        Date startDate, Date endDate);


    PageVo<DriverOrderDetailVo> driverOrderDetailCount(Long driverId, Date start, Date end);

    public Result<Order> autoCallback(Order order, Driver driver);

    public long countRunOrderByPassenger(Long passengerId);
}
